<template>
  <view class="page">
    <!-- 实验目的 -->
    <view class="aim">
      <view class="aim-wrapper">
        <view class="aim-wrapper-title">实验目的 - 增加挂果率</view>
        <view class="aim-wrapper-line"></view>
        <view class="aim-wrapper-text">【试验地块】：{{ "自填的文案" }}</view>
        <view class="aim-wrapper-text">【试验对象】：{{ "橘子" }}</view>
      </view>
    </view>
    <view class="operat update-pics">
      <view class="update-pics-title">
        <text style="color: #4fb718; font-size: 24rpx"
          >本次实验目的是否达成</text
        >
      </view>
      <view class="operat-checkbox-tags">
        <view
          class="operat-checkbox-tag"
          :class="{ 'operat-checkbox-tag-active': item.change }"
          @click="onTagsChange(item)"
          v-for="(item, index) in operatTags"
          :key="index"
          >{{ item.name }}</view
        >
      </view>
    </view>
    <!-- 实验结论 -->
    <view class="update-pics">
      <view class="update-pics-title">
        <text style="color: #4fb718; font-size: 24rpx"
          >填写实验结论（300字以内）</text
        >
      </view>
      <textarea
        class="textarea"
        :maxlength="600"
        placeholder="写下您对本次试验的结论（分析原因，总结经验，可作为以后参考）"
      ></textarea>
      <view class="textarea-num">0/300</view>
    </view>
    <view class="btn-box">
      <button class="btn">
        <text class="btn-text" style="color: #fff">保存</text>
      </button>
    </view>
  </view>
</template>

<script>
import uUpload from "@/components/upload.vue";
export default {
  components: {
    uUpload,
  },
  data() {
    return {
      operatTags: [
        { name: "以达成", change: false },
        { name: "效果不显著", change: false },
        { name: "未达成", change: false },
      ],
      fileList1: [],
    };
  },
  onLoad() {},
  mounted() {},
  computed: {},
  methods: {
    gotoPage(item) {
      this.$u.route({
        url: `/pages/message/details`,
      });
    },
    onTagsChange(value) {
      value.change = !value.change;
      this.operatTags.forEach((item) => {
        if (item.name !== value.name) {
          item.change = false;
        }
      });
    },
  },
};
</script>
<style lang="scss" scoped>
.page {
  padding-top: 20rpx;
  min-height: 100vh;
  background: #f6f6f6;
  padding-bottom: 150rpx;
}
.aim {
  padding: 20rpx 35rpx;
  .aim-wrapper {
    width: 100%;
    border-radius: 10rpx;
    background-color: #fff;
    padding: 35rpx 30rpx 0;
    overflow: hidden;
    &-title {
      font-weight: bold;
      color: #1ac678;
    }
    &-line {
      width: 50rpx;
      height: 10rpx;
      background: #f6f6f6;
      margin: 20rpx 0;
    }
    &-text {
      font-size: 23rpx;
      margin-bottom: 20rpx;
    }
  }
}
.operat {
  margin-bottom: 20rpx;
  &-checkbox {
    width: 100%;
    // min-height: 500rpx;
    background-color: #fff;
    padding: 35rpx 30rpx;
    &-title {
      font-weight: bold;
      font-size: 26rpx;
      color: #202020;
      text-align: center;
      margin-bottom: 20rpx;
    }
    &-hint {
      font-size: 24rpx;
      margin-bottom: 20rpx;
    }
    &-tags {
      display: flex;
      flex-wrap: wrap;
      //   justify-content: space-between;
    }
    &-tag {
      width: 130rpx;
      padding: 5rpx 0;
      text-align: center;
      border: 1px solid #e9e9e9;
      font-size: 24rpx;
      margin-right: 15rpx;
      margin-bottom: 20rpx;
      border-radius: 5rpx;
      &:nth-child(3n) {
        margin-right: 0;
      }
    }
    &-tag-active {
      color: #fff;
      background: #4fb718;
      border: 1px solid #4fb718;
    }
  }
}
.update-pics {
  background: #fff;
  padding: 20rpx 30rpx;
  margin-bottom: 20rpx;
  &-title {
    font-size: 20rpx;
    padding-bottom: 20rpx;
    color: #999;
    border-bottom: 1px solid #e9e9e9;
    margin-bottom: 20rpx;
  }
  .textarea {
    width: 100%;
    font-size: 24rpx;
  }
  .textarea-num {
    font-size: 18rpx;
    color: #999;
    text-align: right;
  }
}
.plus-pic {
  background: #f6f6f6;
  width: 120rpx;
  height: 120rpx;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 20rpx;
  color: #999;
  border: 2px dashed #dcdcdc;
}
.plus-icon {
  width: 50rpx;
  height: 50rpx;
  margin-bottom: 10rpx;
}
.btn-box {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  // position: absolute;
  // bottom: 108rpx;
}
.btn {
  width: 100%;
  background: #4fb718;
  border-radius: 0rpx;
  margin: 0 auto;
  &-text {
    font-size: 32rpx;
    font-weight: 400;
    color: #ffffff;
  }
}
</style>
